package com.example.cc.client.autoconfigure;

import com.example.cc.client.manager.GenericCacheManager;
import com.example.cc.client.refresh.DynamicPropertySource;
import com.example.cc.client.refresh.PropertyRefresher;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;

/**
 * 缓存管理、属性刷新等
 */
@Configuration
@Import(value = {
        DynamicPropertySource.class,
        PropertyRefresher.class
})
@ComponentScan(basePackages = "com.example.cc")//偷懒这么写
public class ConfigExtendAutoConfiguration {

    @Bean
    public GenericCacheManager<String, String> stringCacheManager() {
        return new GenericCacheManager<>();
    }

    @Bean
    public GenericCacheManager<String, Object> cacheManager() {
        return new GenericCacheManager<>();
    }
}
